package test.com.sms.selenium.singlepoint.util;

import org.openqa.selenium.By;

import test.com.sms.selenium.framework.SeleniumPageUtil;
import test.com.sms.selenium.util.SeleniumUtil;

public class SpActivityBoardAddAssetsPageUtil extends SeleniumPageUtil {
	
	public final static By ABAS_LINK_ADD_USING_TEMPLATE = By.id("ctl44_btnLikeAsset");
	public final static By ABAS_LINK_ADD_SMS_COVERAGE = By.id("ctl44_btnCoverageAdd");
	public final static By ABAS_LINK_SAVE = By.id("ctl44_btnSave");
	public final static By ABAS_LINK_DELETE = By.id("ctl44_btnDelete");
	public final static By ABAS_LINK_CLOSE = By.id("ctl44_btnDone");
	public final static By ABAS_TD_HEADER_TEXT = By.xpath("//*[@id='form1']/table/tbody/tr[2]/td/div/table[1]/tbody/tr/td[2]");
	
	public final static By ABAS_SPAN_TITLE = By.id("ctl44_lblContractOptional");
	public final static By ABAS_SPAN_TITLE_COMMENT = By.id("ctl44_lblContractOptional2");
	
	public final static By ABAS_TD_CONTRACT_ID_LABEL = By.xpath("//*[@id='form1']/table/tbody/tr[2]/td/div/table[2]/tbody/tr[2]/td[1]");
	public final static By ABAS_INPUT_CONTRACT_ID = By.id("ctl44_txtContractID");
	public final static By ABAS_TD_TYPE = By.xpath("//*[@id='form1']/table/tbody/tr[2]/td/div/table[2]/tbody/tr[3]/td[1]");
	public final static By ABAS_SPAN_TYPE = By.id("ctl44_lblType");
	public final static By ABAS_TD_STATUS = By.xpath("//*[@id='form1']/table/tbody/tr[2]/td/div/table[2]/tbody/tr[4]/td[1]"); 
	public final static By ABAS_SPAN_STATUS = By.id("ctl44_lblStatus");
	public final static By ABAS_TD_START_DATE = By.xpath("//*[@id='form1']/table/tbody/tr[2]/td/div/table[2]/tbody/tr[5]/td[1]"); 
	public final static By ABAS_INPUT_START_DATE = By.id("ctl44_txtReqStartDate");
	public final static By ABAS_IMG_START_DATE = By.id("ctl44_imgReqStartDate");
	public final static By ABAS_TD_END_DATE = By.xpath("//*[@id='form1']/table/tbody/tr[2]/td/div/table[2]/tbody/tr[5]/td[3]");
	public final static By ABAS_INPUT_END_DATE = By.id("ctl44_txtReqEndDate");
	public final static By ABAS_IMG_END_DATE = By.id("ctl44_imgReqEndDate");
	public final static By ABAS_TD_SLA_TERMS = By.xpath("//*[@id='form1']/table/tbody/tr[2]/td/div/table[2]/tbody/tr[6]/td[1]");
	public final static By ABAS_CHECK_SLA_TERMS = By.id("ctl44_chkSLAAll");
	public final static By ABAS_SELECT_SLA_TERMS = By.id("ctl44_cboSLATermID");		
	
	/* Asset Information */
	public final static By ABAS_SPAN_ASSET_INFORMATION = By.id("ctl44_lblAssetInfo");
	public final static By ABAS_RADIO_ADD_ONE_MORE_ASSETS = By.id("ctl44_rdoAddOne");
	public final static By ABAS_LABEL_ADD_ONE_MORE_ASSETS = By.xpath("//label[@for='ctl44_rdoAddOne']");
	public final static By ABAS_RADIO_COPY_PASTE_FROM_EXCEL = By.id("ctl44_rdoAddDrag");
	public final static By ABAS_LABEL_COPY_PASTE_FROM_EXCEL = By.xpath("//label[@for='ctl44_rdoAddDrag']");
	public final static By ABAS_TD_MFG_NAME = By.xpath("//*[@id='ctl44_trMfg']/td[1]");
 	public final static By ABAS_INPUT_MFG_NAME = By.id("ctl44_txtMfgName");
	public final static By ABAS_TD_MODEL = By.xpath("//*[@id='ctl44_trMfg']/td[3]");
	public final static By ABAS_INPUT_MODEL = By.id("ctl44_txtModelCode");
	public final static By ABAS_TD_QTY_TO_ADD = By.xpath("//*[@id='ctl44_trQty']/td[1]");
	public final static By ABAS_INPUT_QTY_TO_ADD = By.id("ctl44_txtQty");
	public final static By ABAS_TD_SERIAL_NUMBER = By.xpath("//*[@id='ctl44_trSerialNumber']/td[1]");
 	public final static By ABAS_INPUT_SERIAL_NUMBER = By.id("ctl44_txtSerialNumber");
	public final static By ABAS_TD_ASSET_NAME = By.xpath("//*[@id='ctl44_trSerialNumber']/td[3]");
	public final static By ABAS_INPUT_ASSET_NAME = By.id("ctl44_txtAssetName");
	
	public final static By ABAS_TD_ASSET_TYPE = By.xpath("//*[@id='ctl44_trAssetType']/td[1]");
	public final static By ABAS_INPUT_ASSET_TYPE = By.id("ctl44_txtAssetType");
	public final static By ABAS_TD_ASSET_DESCRIPTION = By.xpath("//*[@id='ctl44_trAssetDescription']/td[1]");
	public final static By ABAS_INPUT_ASSET_DESCRIPTION = By.id("ctl44_txtAssetDescription");
	
	public final static By ABAS_TD_SITE_ADDRESS = By.xpath("//*[@id='form1']/table/tbody/tr[2]/td/div/table[2]/tbody/tr[16]/td[1]");
	public final static By ABAS_LINK_NEW_SITE_ADDRESS = By.id("ctl44_btnAddressNew");
	public final static By ABAS_INPUT_SITE_ADDRESS = By.id("ctl44_txtAddress");
	
	public final static By ABAS_SPAN_SITE_CONTRACT = By.id("ctl44_lblSiteContact");
	public final static By ABAS_LINK_NEW_SITE_CONTRACT = By.id("ctl44_btnContactNew");
	public final static By ABAS_INPUT_SITE_CONTRACT = By.id("ctl44_txtContact");
	
	public final static By ABAS_TD_COMMENTS = By.xpath("//*[@id='form1']/table/tbody/tr[2]/td/div/table[2]/tbody/tr[18]/td[1]");
	public final static By ABAS_TEXTAREA_COMMENTS = By.id("ctl44_txtComment");
	
	public static void waitForPageToLoad(){
		SeleniumUtil.waitOnElements(new By[]{
			ABAS_LINK_SAVE, ABAS_LINK_DELETE, ABAS_LINK_CLOSE, ABAS_IMG_START_DATE, ABAS_IMG_END_DATE, 
			ABAS_TEXTAREA_COMMENTS
		});
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(ABAS_IMG_START_DATE));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(ABAS_IMG_END_DATE));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(ABAS_TEXTAREA_COMMENTS));
		SeleniumUtil.isEnabled(SeleniumUtil.findElement(ABAS_TEXTAREA_COMMENTS));
	}
	
}
